Simple utilities for ZNP examples. It is recommended that you modify or replace these in a "real" application. More...
#include "../HAL/hal.h"#include "../ZNP/znp_interface.h"#include "../ZNP/af_zdo.h"#include "../ZNP/znp_interface_spi.h"Functions | |
| void | handleReturnValue () |
| void | pollAndDisplay () |
| void | waitForDeviceState (unsigned char expectedState) |
| void | displayReceivedMessages () |
| void | displayReceivedMessagesAndFindDevice () |
Variables | |
| unsigned char | znpBuf [100] |
| signed int | znpResult |
Simple utilities for ZNP examples. It is recommended that you modify or replace these in a "real" application.
YOU ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
| void displayReceivedMessages | ( | ) |
Waits for SRDY to go low, indicating a message has arrived. Displays the msg to console.
| void displayReceivedMessagesAndFindDevice | ( | ) |
Waits for SRDY to go low, indicating a message has arrived. Displays the msg to console, and find the device's MAC address using ZDO_IEEE_ADDR_REQ. Then, if FIND_NWK_ADDRESS was defined, uses the received MAC address to find the device's short address. The two should match.
| void pollAndDisplay | ( | ) |
Poll the ZNP for any messages and display them to the console.
| void waitForDeviceState | ( | unsigned char | expectedState | ) |
Blocking wait until a message is received. Exits if received message is a ZDO_STATE_CHANGE_IND and the state matches what we want. Else loops.
| expectedState | the deviceState we are expecting - DEV_ZB_COORD etc. |
1.6.3